package com.huluobo.h3weekdemo.main

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.h3weekdemo.R

/**
 *  Created by LC on 2023/11/1.
 */
class NewsAdapter(list: MutableList<NewsBean>) : BaseQuickAdapter<NewsBean, BaseViewHolder>(R.layout.item_news, list) {
    override fun convert(holder: BaseViewHolder, item: NewsBean) {
        holder.setText(R.id.news_title, item.title)
        holder.setText(R.id.news_auth, item.auth)
        holder.setText(R.id.news_desc, item.description)
        Glide.with(context).load(item.mainimgurl).into(holder.getView(R.id.news_img))
    }
}